<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
    <title>GitHub Flavored Markdown - Live Preview</title>
    <link href="/css/markdown-preview.css" rel="stylesheet" type="text/css"/>
    <link href="/css/github-gist.css" rel="stylesheet" type="text/css"/>
    <script src="/script/require.js" type="text/javascript"></script>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            require.config({
                paths: {
                    "highlight": "script/highlight",
                    "marked": "script/marked",
                }
            });
            markColor();
            $("#user_input").keyup(function () {
                markColor();
            });

            function markColor() {
                var txt = $("#user_input").val();
                // <![CDATA[
                require(['marked', 'highlight'], function (marked, hljs) {
                    $('.wikistyle').html(marked(txt, {
                        renderer: new marked.Renderer(),
                        gfm: true,
                        tables: true,
                        breaks: false,
                        pedantic: false,
                        sanitize: false,
                        smartLists: true,
                        smartypants: false
                    }));
                    $('pre code').each(function (i, block) {
                        hljs.highlightBlock(block);
                    });
                });
            }

            //]]>
        });
    </script>
</head>
<body>
<div id="content" class="site">
    <div id="entry-container">
        <em>Enter Markdown</em>
        <p><textarea id="user_input" th:inline="text">
```javascript
//<![CDATA[
<script type="text/javascript" src="jquery-logger.js"></script>
<script type="text/javascript">
  $(function () {
      $.logClear();
      $.logAssert(1 < 0, "error message");
      $.logCount("hello");
      $.logDebug();
      $.logDebug("hello: {},{}", "jquery", "logger");
      $.logError("hello: {},{}", "jquery", "logger");
      $.logInfo("hello: {},{}", "jquery", "logger");
      $.log("hello: {},{}", "jquery", "logger");
      $.logTable([new User("Tom", "Andy"), new User("Jerry", "Andy")]);
      $.logTrace("hello: {},{}", "jquery", "logger");
      $.logWarn("hello: {},{}", "jquery", "logger");
      $.logGroup("hello: {},{}", "jquery", "logger");
      $.log("jquery");
      $.log("logger");
      $.logGroupEnd();
      $.logGroupCollapsed("hello: {},{}", "jquery", "logger");
      $.log("jquery");
      $.log("logger");
      $.logGroupEnd();

      function User(firstName, lastName) {
          this.firstName = firstName;
          this.lastName = lastName;
      }
  })
</script>
//]]>
```
        </textarea></p>
    </div>
    <div id="preview-container">
        <em>Live preview</em>
        <div id="readme" class="announce md markdown-body" data-path="/">
            <div class="wikistyle content-body highlight highlight-source-js">
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    //    var _gaq = _gaq || [];
    //    _gaq.push(['_setAccount', 'UA-633948-2']);
    //    _gaq.push(['_trackPageview']);
    //    (function () {
    //        var ga = document.createElement('script');
    //        ga.type = 'text/javascript';
    //        ga.async = true;
    //        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    //        var s = document.getElementsByTagName('script')[0];
    //        s.parentNode.insertBefore(ga, s);
    //    })();
</script>
</body>
</html>
